package com.spsoft.dmzeinvoice.controller;

import com.spsoft.core.annotation.AnonymousAccess;
import com.spsoft.core.model.Result;
import com.spsoft.core.model.leqidmz.param.*;
import com.spsoft.core.model.leqidmz.response.*;
import com.spsoft.dmzeinvoice.common.annotation.DmzLog;
import com.spsoft.dmzeinvoice.service.VmsBaseInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = {"基础信息模块"})
@RequestMapping("/baseInfo")
@RestController
@RequiredArgsConstructor
public class VmsBaseInfoController {

    /**
     * 纳税人基本信息请求地址
     */
    private final VmsBaseInfoService vmsBaseInfoService;

    /**
     * 查询纳税人企业基本信息
     */
    @ApiOperation("查询纳税人企业基本信息")
    @DmzLog(leqiName = "查询纳税人企业基本信息")
    @AnonymousAccess(value = "/queryEnterpriseInfo", method = RequestMethod.POST, permissionCode = "")
    public Result<QueryEnterpriseInfoVO> queryEnterpriseInfo(@RequestBody @Validated BaseNsrRequestParams params) {
        return vmsBaseInfoService.queryEnterprise(params);
    }

    /**
     * 查询纳税人风险信息
     */
    @ApiOperation("查询纳税人风险信息")
    @DmzLog(leqiName = "查询纳税人风险信息")
    @AnonymousAccess(value = "/queryEnterpriseRisk", method = RequestMethod.POST, permissionCode = "")
    public Result<QueryEnterpriseInfoRiskVO> queryEnterpriseRisk(@RequestBody @Validated BaseNsrRequestParams params) {
        return vmsBaseInfoService.queryEnterpriseRisk(params);
    }

    /**
     * 查询纳税人分类编码信息
     */
    @ApiOperation("查询纳税人分类编码信息")
    @DmzLog(leqiName = "查询纳税人分类编码信息")
    @AnonymousAccess(value = "/queryClassifyCode", method = RequestMethod.POST, permissionCode = "")
    public Result<QueryClassifyCodeVO> queryClassifyCode(@RequestBody @Validated QueryClassifyCodeParams params) {
        return vmsBaseInfoService.queryClassifyCode(params);
    }

    /**
     * 查询可用税率信息
     */
    @ApiOperation("查询可用税率")
    @DmzLog(leqiName = "查询可用税率")
    @AnonymousAccess(value = "/queryAvalibleTaxRate", method = RequestMethod.POST, permissionCode = "")
    public Result<QueryAvalibleTaxRateVo> queryAvalibleTaxRate(@RequestBody BaseNsrRequestParams params) {
        return vmsBaseInfoService.queryAvalibleTaxRate(params);
    }

    /**
     * 查询授信额度
     */
    @ApiOperation("查询授信额度")
    @DmzLog(leqiName = "查询授信额度")
    @AnonymousAccess(value = "/queryCreditLimit", method = RequestMethod.POST, permissionCode = "")
    public Result<QueryCreditlimitVO> queryCreditLimit(@RequestBody BaseNsrRequestParams params) {
        return vmsBaseInfoService.queryCreditLimit(params);
    }

    /**
     * 调整授信额度有效期
     */
    @ApiOperation("调整授信额度有效期")
    @DmzLog(leqiName = "调整授信额度有效期")
    @AnonymousAccess(value = "/queryCreditPeriod", method = RequestMethod.POST, permissionCode = "")
    public Result<QueryCreditPeriodVO> queryCreditPeriod(@RequestBody QueryCreditPeriodParams params) {
        return vmsBaseInfoService.queryCreditPeriod(params);
    }

    /**
     * 下载/退回授信额度
     */
    @ApiOperation("下载/退回授信额度")
    @DmzLog(leqiName = "下载/退回授信额度")
    @AnonymousAccess(value = "/applyCredit", method = RequestMethod.POST, permissionCode = "")
    public Result<ApplyCreditVO> applyCredit(@RequestBody ApplyCreditParams params) {
        return vmsBaseInfoService.applyCredit(params);
    }

    /**
     * 获取数电票批量预赋码信息
     */
    @ApiOperation("获取数电票批量预赋码信息")
    @DmzLog(leqiName = "获取数电票批量预赋码信息")
    @AnonymousAccess(value = "/assignedCode", method = RequestMethod.POST, permissionCode = "")
    public Result<AssignedCodeResponseVO> assignedCode(@RequestBody AssignedCodeParams params) {
        return vmsBaseInfoService.assignedCode(params);
    }

    /**
     * 查询差额征税编码信息
     */
    @ApiOperation("查询差额征税编码信息")
    @DmzLog(leqiName = "查询差额征税编码信息")
    @AnonymousAccess(value = "/queryDifferentialTaxCode", method = RequestMethod.POST, permissionCode = "")
    public Result<QueryDifferentialTaxationVO> queryDifferentialTaxCode(@RequestBody BaseUserInfoParam params) {
        return vmsBaseInfoService.differential(params);
    }

    /**
     * 查询差额征税编码信息
     */
    @ApiOperation("查询不动产销售房源信息")
    @DmzLog(leqiName = "查询不动产销售房源信息")
    @AnonymousAccess(value = "/queryHouseInfo", method = RequestMethod.POST, permissionCode = "")
    public Result<QueryHouseInfoVO> queryHouseInfo(@RequestBody QueryHouseInfoParams params) {
        return vmsBaseInfoService.queryHouseInfo(params);
    }

}
